package com.rdc.qingkou.ui;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;

import com.rdc.qingkou.Application.MyApplication;
import com.rdc.qingkou.R;

/**
 * Created by asus on 2017/8/6.
 */

public class ChooseImageDialogActivity extends AppCompatActivity implements View.OnClickListener{
    private Button mTakePhoto;
    private Button mChooseAlbum;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        MyApplication.addActivity(this);
        setContentView(R.layout.send_addmedia);
        init();

    }

    private void init(){
        mTakePhoto = (Button)findViewById(R.id.btn_takePhoto);
        mChooseAlbum = (Button)findViewById(R.id.btn_chooseAlbum);

        mTakePhoto.setOnClickListener(this);
        mChooseAlbum.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        Intent intent  = new Intent();
        switch (v.getId()){
            case R.id.btn_takePhoto:
                intent.putExtra("DOWN", "takePhoto");
                setResult(RESULT_OK, intent);
                finish();
                break;
            case R.id.btn_chooseAlbum:
                intent.putExtra("DOWN", "chooseAlbum");
                setResult(RESULT_OK, intent);
                finish();
                break;
            default:
                break;

        }
    }


}
